package com.hz.blogService.utils;

import com.hz.blogService.domain.Blog;
import org.springframework.stereotype.Component;

/**
 * @author LiiiYiAn
 * @version 1.0
 * @createDate 2023-10-06 14:14
 * @projectName SchoolServicePlatformFinal
 * @className Commons
 * @description 页面数据展示封装类
 */
@Component
public class Commons {
    /**
     * 显示文章缩略图，顺序为：文章第一张图 -> 随机获取
     */
    public String show_thumb(Integer id) {
        int size = id % 12;
        size = size == 0 ? 1 : size;

        return "static/img/rand/" + size + ".png";
    }
}
